package org.example.Server.controller.user;

import lombok.extern.slf4j.Slf4j;
import org.example.Server.model.user.UserDTO;
import org.example.Server.service.user.UserService;
import org.example.Server.utils.ResultAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 用户注册
 */
@RestController
@Slf4j
@RequestMapping("/youxich/user")
public class RegisterController {
    @Autowired
    UserService userService;
    @PostMapping("/register")
    public ResultAPI register(@RequestBody UserDTO user) {
        log.info("register user: {}", user);
        return userService.register(user);
    }
}
